package com.sky.controller.admin;

import com.sky.result.Result;
import com.sky.service.Shopstatusservice;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController("adminshopcontroller")
@Slf4j
@Api("营业设置接口")
@RequestMapping("/admin/shop")
public class ShopContoller {
    @Autowired
    Shopstatusservice   shopstatusservice;
    @GetMapping("/status")
    public Result<Integer> getsuatus(){
Integer suatus = shopstatusservice.getshopstatus();
return Result.success(suatus);
    }
    @PutMapping("{status}")
    public  Result setsuatus(@PathVariable Integer status){
        log.info("设置营业状态:{}",status);
        shopstatusservice.setshopstatus(status);

        return Result.success();
    }
}
